﻿@page "/ClearAGING2KWPage"
@inject ModalService _modalService
@inject MessageService _message
@inject AG2WareHouseServer _ag2WareHouseServer
<h3>清空库位信息</h3>
<br>
<br>
<Row>
    <Col Span="24">
    <Input style="width:100%" Placeholder="Basic usage" @bind-Value="@Remark" />
    </Col>
</Row>
<br>

<h5>物料状态</h5>
<Select DataSource="@GlobalValues.MaterialTypes"
        AllowClear="true"
        ValueOnClear="@(1)"
        @bind-Value="@select"
        ValueName="@nameof(Val_Des.Val)"
        LabelName="@nameof(Val_Des.Description)">
</Select>
<br>
<br>
<Row>
    <Col Span="24">
    <Button style="width:100%" Type="@ButtonType.Primary" @onclick="@Creat">清空库位信息</Button>
    </Col>
</Row>
@code {
    private string Remark;
    //选择物料的状态
    private int select;
    private async Task Creat()
    {
        _modalService.Confirm(new ConfirmOptions()
            {
                Title = "提示",
                Icon =@<Icon Type="exclamation-circle" Theme="Outline"></Icon>,
            Content = "是否提交？",
            OkText = "确认",
            OnOk = async (e) =>
            {
                if (String.IsNullOrEmpty(Remark))
                {
                    await _message.Info("请输入库位编号");
                    return;
                }
                else
                {
                    string remark = Remark.Trim();
                    var result = await _ag2WareHouseServer.ClearAG2WareHouse(remark,select);
                    await _message.Info(result);
                }

            },
            CancelText = "取消"
        });


    }
}
